import request from '@/config/axios'

export interface BusinessConfigVO {
  id: number
  code: string
  name: string
  type: string
  value: string
  remark: string
}

// 查询业务配置分页
export const getBusinessConfigPage = async (params) => {
  return await request.get({ url: `/meijia/business-config/page`, params })
}

// 查询业务配置详情
export const getBusinessConfig = async (id: number) => {
  return await request.get({ url: `/meijia/business-config/get?id=` + id })
}

// 新增业务配置
export const createBusinessConfig = async (data: BusinessConfigVO) => {
  return await request.post({ url: `/meijia/business-config/create`, data })
}

// 修改业务配置
export const updateBusinessConfig = async (data: BusinessConfigVO) => {
  return await request.put({ url: `/meijia/business-config/update`, data })
}

// 删除业务配置
export const deleteBusinessConfig = async (id: number) => {
  return await request.delete({ url: `/meijia/business-config/delete?id=` + id })
}

// 导出业务配置 Excel
export const exportBusinessConfig = async (params) => {
  return await request.download({ url: `/meijia/business-config/export-excel`, params })
}